<?php 
//载入函数
include '../../functions.php';
//载入smarty
include '../smarty/libs/Smarty.class.php';
//实例化
$smarty = new Smarty;
//模板目录
$smarty->template_dir = "template";
//编译目录
$smarty->compile_dir = "temp/compile";
//缓存目录
$smarty->cache_dir = "temp/cache";
//开启缓存
$smarty->caching = true;
//缓存时间
$smarty->cache_lifetime = 10;
//清除缓存
//$smarty->clear_cache();
//开始定界符
$smarty->left_delimiter = "{{";
//结束定界符
$smarty->right_delimiter = "}}";


session_start();
//$_SESSION['uname'] = "admin";

//判断缓存是否失效
if(!$smarty->is_cached('index.html'))
{
	$data = time();
	$smarty->assign('time',$data);
	
}

$time1 = time();
$smarty->assign('time1',$time1);
//注册局部不缓存的块标签
//参数：标签名称、函数名称
$smarty->register_block('nocache','nocache',false);
function nocache($params,$content,&$smarty){
//	var_dump($params);
//	var_dump($content);
	return $content;
}








//载入模板
$smarty->display('index.html');

